import { fromJS } from "immutable";
import { constants } from ".";

const initialState = fromJS({
  title: '',
  content: ''
});

const reducer = (state = initialState, action) => {
  const { type, payload } = action;
  switch (type) {
    case constants.UPDATE_DETAIL_DATE:
      return state.merge({
        title: payload.title,
        content: payload.content
      });
    default:
      return state;
  }
}

export default reducer;